<template>
  <div>
    <j-modal
      :title="title"
      :width="800"
      :visible="visible"
      switchFullscreen
      @ok="handleOk"
      @cancel="handleCancel"
      :footer="false"
    >
      <a-descriptions>
        <a-descriptions-item label="建议反馈">
          {{obj.opinion}}
        </a-descriptions-item>
        <a-descriptions-item label="反馈用户姓名">
         {{obj.userName}}
        </a-descriptions-item>
        <a-descriptions-item label="反馈类型">
        {{obj.opinionType}}
        </a-descriptions-item>
      </a-descriptions>
      <a-descriptions>
        <a-descriptions-item label="图片">
          <img
          v-for="(item, index) in imgList"
          :key="index"
          :src="item"
          style="width: 100px;height: 100px;margin-left: 20px;"
          @click="detailimg(item)"
        />
        </a-descriptions-item>
      </a-descriptions>
      <a-form-model ref="form">
        <!-- <img
          v-for="(item, index) in imgList"
          :key="index"
          :src="ImgPaths(item)"
          style="width: 100px;height: 100px;margin-left: 20px;"
          @click="detailimg(item)"
        /> -->
      </a-form-model>
    </j-modal>
  </div>
</template>

<script>
import { getAction } from "@/api/manage";
import { imgpath } from "@/api/tsapi";
export default {
  name: "detailModal",
  props: {
    id: {
      type: String,
      default: "id",
    },
  },
  data() {
    return {
      title: "查看意见详情",
      visible: true,
      url: {
        specific: "/opinionPc/busOpinionPc/specific",
      },
      imgList: [],
      obj: {},
    };
  },
  mounted() {
    console.log(this.id, "ids");
    let httpurl = this.url.specific;
    let params = { id: this.id };
    getAction(httpurl, params).then((res) => {
      this.obj = res.result;
      this.imgList = res.result.opinionPathList;
    });
  },
  methods: {
    handleOk() {
      this.$parent.$parent.showdetail = false
      console.log((this.$parent.$parent.showdetail = false), "this");
    },
    handleCancel() {
      this.$parent.$parent.showdetail = false
      console.log((this.$parent.$parent.showdetail = false), "this");
    },
    detailimg(item) {
      window.open(item);
    },
    ImgPaths: function(params) {
      console.log(imgpath(params), "imgpath(params)");
      return imgpath(params);
    },
  },
};
</script>

<style lang="less" scoped></style>
